package com.gitee.huanminabc.jnetty.server.handler;

import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.http.FullHttpRequest;
import io.netty.handler.codec.http.HttpHeaders;
import io.netty.handler.codec.http.HttpMethod;

/**
 * @author huanmin
 * @date 2023/12/1
 */
public interface HttpInterfaceHandler {
    boolean preHandler(ChannelHandlerContext ctx,FullHttpRequest request, String contentType, HttpMethod method, String uri, HttpHeaders headers, ByteBuf content) throws Throwable;
    void handler(ChannelHandlerContext ctx,FullHttpRequest request, String contentType, HttpMethod method, String uri, HttpHeaders headers, ByteBuf content) throws Throwable;
    void postHandler(ChannelHandlerContext ctx, FullHttpRequest req, String contentType, HttpMethod method, String uriStr, HttpHeaders headers, ByteBuf content,long executeTime);
    void exceptionCaught(ChannelHandlerContext ctx, FullHttpRequest req, String contentType, HttpMethod method, String uriStr, HttpHeaders headers, ByteBuf content,Throwable cause) ;
}
